﻿<ul>

       @if (@ViewBag.SeachDataBase != null)
        {
            string selected = "";
            if (ViewBag.SelectedDataBase != null)
            {
                selected = "," + ViewBag.SelectedDataBase + ",";//加逗号，防止判断时ID出现部分叠加重复情况
            }
        @Html.Raw("<li class=\"talkDivLi\">")
        @Html.Raw("<div class=\"talkDivLiT\" style=\"font-size: 14px\">数据库列表</div>") 
            foreach (CNKI.TPI.Web.Search.Model.DBCONFIG item in ViewBag.SeachDataBase)
            {
                string strcheck = "";
                if (selected.IndexOf("," + @item.DbID.ToString() + ",") > -1)//已经在首页选中，则默认选中
                {
                    strcheck = "checked=checked";
                }
        @Html.Raw("<a  href=\"javascript:void(0)\"><label style=\"font-size:12px;margin:0px;\"  class=\"f-label col-md-3 text-ellipsis\"><input type=\"checkbox\" " + @strcheck + " value=" + item.DbID + " class=\"f-checkbox\" />" + item.CNName + "</label></a>")
                               
                           
            }
        @Html.Raw("</li>");
        }

</ul>
